package com.talkyun.utils;

/**
 * JDK common helper class
 * <p/>
 * Created by kevin on 15/11/18.
 */
public class JdkHelper {

    public static boolean isJdkVersion(int ver) {
        String ver2 = System.getProperty("java.version");
        if (ver == 4) {
            return ver2.startsWith("1.4");
        } else if (ver == 5) {
            return ver2.startsWith("1.5");
        } else if (ver == 6) {
            return ver2.startsWith("1.6");
        } else if (ver == 7) {
            return ver2.startsWith("1.7");
        } else if (ver == 8) {
            return ver2.startsWith("1.8");
        } else if (ver == 9) {
            return ver2.startsWith("1.9");
        }
        return false;
    }

    public static boolean isJdkVersion(String ver) {
        return System.getProperty("java.version").startsWith(ver);
    }
}